package com.example.filesave;

import android.database.sqlite.SQLiteDatabase;
import android.support.test.runner.AndroidJUnit4;
import android.test.AndroidTestCase;

import com.example.filesave.sql.MyOpenHelper;

import org.junit.Test;
import org.junit.runner.RunWith;

import static android.support.test.InstrumentationRegistry.getContext;

/**
 * Created by Administrator on 2018/1/17.
 */
@RunWith(AndroidJUnit4.class)
public class SqlTest {

    @Test
    public void test(){
        // 虚拟上下文
        MyOpenHelper openHelper = new MyOpenHelper(getContext(),"book.db",null,2);
        // 如果数据库不存在，就先创建再打开
        SQLiteDatabase db = openHelper.getWritableDatabase();

    }

}
